/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package questionbook.service;

import questionbook.model.Person;
import questionbook.service.common.GenericServiceImpl;
import questionbook.standard.Foaf;

/**
 *
 * @author stefanstift
 */
public class FriendshipServiceBean extends GenericServiceImpl implements FriendshipService {

    public void addFriendship(Person p1, Person p2) {
        this.storeManager.getStore().add(p1.getUri(), Foaf.getInstance().getKnowsURI(), p2.getUri());
    }

    public void deleteFriendship(Person p1, Person p2) {
        this.storeManager.getStore().removeTuplePattern(p1.getUri(), Foaf.getInstance().getKnowsURI(), p2.getUri());
        this.storeManager.getStore().removeTuplePattern(p2.getUri(), Foaf.getInstance().getKnowsURI(), p1.getUri());
    }
}
